package com.aaa.service.impl;

import com.aaa.dao.TestResultSdsDao;
import com.aaa.entity.MyReturn;
import com.aaa.service.TestResultSdsService;
import com.aaa.service.TesterSDSService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class TestResultSdsServiceImpl implements TestResultSdsService {
    @Autowired
    private TestResultSdsDao testResultSdsDao;



    /**
     * 将用户测试答案放入数据库中
     * @param list
     * @return
     */
    @Override
    public boolean insertTestSds(List<Map> list) {
        Integer i=null;
        for(Map<String,Object> map:list){
            i=testResultSdsDao.insertTestSds(map);
        }
        if(i>0&&i!=null){
            return true;
        }
        return false;
    }

    @Override
    public boolean deleteTestResultSdsById(Integer id) {
        int deleteTestResultSdsById = testResultSdsDao.deleteTestResultSdsById(id);
        if (deleteTestResultSdsById>0){
            return  true;
        }
        return false;
    }

    @Override
    public boolean deleteTestResultSdsBatch(String id) {
        int deleteTestResultSdsBatch = testResultSdsDao.deleteTestResultSdsBatch(id);
        if (deleteTestResultSdsBatch>0){
            return true;
        }
        return false;
    }


}
